package com.huluobo.a2107monthdemo.home

import androidx.lifecycle.MutableLiveData
import com.huluobo.a2107monthdemo.base.BaseViewModel

/**
 *  Created by LC on 2023/11/30.
 */
class HomeViewModel : BaseViewModel() {
    private val repo = HomeRepo()
    val getHomeGoodsListSuccess = MutableLiveData<HomeGoodsListBeanResult>()
    val getHomeGoodsListFailed = MutableLiveData<String>()

    val getHomeBannerSuccess = MutableLiveData<HomeBannerBeanResult>()
    val getHomeBannerFailed = MutableLiveData<String>()

    val getHomeNavSuccess = MutableLiveData<HomeNavBeanResult>()
    val getHomeNavFailed = MutableLiveData<String>()

    fun getHomeGoodsList(
        categoryId: Int,
        currentPage: Int,
        pageSize: Int,
    ) {
        repo.getHomeGoodsList(categoryId, currentPage, pageSize, getHomeGoodsListSuccess, getHomeGoodsListFailed)
    }

    fun getHomeBanner() {
        repo.getHomeBanner(getHomeBannerSuccess, getHomeBannerFailed)
    }

    fun getHomeNav() {
        repo.getHomeNav(getHomeNavSuccess, getHomeNavFailed)
    }
}